<?php

namespace App\Http\Controllers\OATrait;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Schema;

/**
 * 新建项目
 */
trait ProjectTrait
{

    protected $table_list = [
        'lx'=>['table'=>'oas_project_lx','work_id'=>1],
        'ys'=>['table'=>'oas_project_ys','work_id'=>3],
        'js'=>['table'=>'oas_project_lx','work_id'=>3],
    ];

    protected static $timestamp = '';

    public function __construct()
    {
        self::$timestamp = date('Y-m-d H:i:s');
    }

    protected function addNewProjectData($type,$params)
    {
        try{
            DB::beginTransaction();

            $project = $this->table_list[$type];

            $table = $project['table'];

            #1.过滤多余参数
            //$params =

            #2.



            DB::commit();

        }catch (\Exception $e){
            DB::rollBack();

            throw new \Exception($e->getMessage());
        }
    }
}
